<?php slot('js_insideLoadFunction')?>
ADMIN_FILTER.key_search = '<?php echo __('filter_key_search',null,'table_list')?>';
ADMIN_FILTER.enabled = '<?php echo (intval($data['filter']['filter_enabled'])>=0 && intval($data['filter']['filter_enabled'])<=1)?$data['filter']['filter_enabled']:'-1'?>';
ADMIN_FILTER.action = {
	error:{
		rowSelectedEmpty: '<?php echo __('error_row_selected', null, 'table_list')?>'
	},
	confirm:{
		deleteConfirm: '<?php echo __('row_delete_confirm', null, 'table_list')?>'
	}
}
ADMIN_FILTER.initFilter();
$('#filter_staff_number_id').val('<?php echo $data['filter']['filter_staff_number_id']?>').attr('selected', true);
$('#filter_location_city_id').val('<?php echo $data['filter']['filter_location_city_id']?>').attr('selected', true);
<?php end_slot()?>

<?php slot('header_css')?>
<style type="text/css">
<!-- 
/*div.box-content-main table.table-list td.cate_id{
	width: 200px;
}
div.box-content-main table.table-list td.title{
	width: 200px;
}
div.box-content-main table.table-list td.description{
	width: 200px;
}
div.box-content-main table.table-list td.tags{
	width: 100px;
}*/
div.box-content-main table.table-list td.city{
	width: 120px;
}
-->
</style>
<?php end_slot()?>
<div class="box-navigation">
	<?php echo $data['navigation']?>
</div>
<div class="clr"></div>
<div class="box-filter">
	<form action="?" method="get" name="filter_form" id="filter_form">
		<select name="filter[filter_location_city_id]" id="filter_location_city_id" class="combo-box">
			<option value="-1"><?php echo __('option_filter_location_city_id', null, 'company_companies')?></option>
			<?php foreach($data['filter_location_city'] as $val):?>
			<option value="<?php echo $val['id']?>"><?php echo $val['name']?></option>
			<?php endforeach;?>
		</select>
		<select name="filter[filter_staff_number_id]" id="filter_staff_number_id" class="combo-box">
			<option value="-1"><?php echo __('option_filter_staff_number_id', null, 'company_companies')?></option>
			<?php foreach($data['filter_form_staff_number'] as $val):?>
			<option value="<?php echo $val['id']?>"><?php echo $val['number_name']?></option>
			<?php endforeach;?>
		</select>
		<input type="text" maxlength="255" name="filter[filter_key]" id="filter_key" value="<?php echo empty($data['filter']['filter_key'])?__('filter_key_search',null,'table_list'):$data['filter']['filter_key']?>"/>
		<input type="submit" name="filter[filter_submit]" id="filter_submit" class="button" value="<?php echo __('filter_submit',null,'table_list')?>"/>
	</form>
</div>
<div class="clr"></div>
<div class="box-content">
	<form action="<?php echo $data['filter_action']?>" method="post" name="form_main" id="form_main">
		<input type="hidden" value="-1" name="action_token" id="action_token"/>
		<input type="hidden" value="none" name="action_name" id="action_name"/>
		<div class="control">
			<a href="#" class="a-control-get add" data-action="<?php echo ADMIN_DEFINED::ADD_RECORD?>" data-require="none"><?php echo __('control_add',null,'table_list')?></a>
			<a href="#" class="a-control delete" data-action="<?php echo ADMIN_DEFINED::DELETE_RECORD?>" data-require="selected" data-confirm="confirm"><?php echo __('control_delete',null,'table_list')?></a>
		</div>
		<div class="clr"></div>
		<div class="box-content-main">
			<table class="table-list" cellspacing="0" cellpadding="0" border="0">
				<tr>
					<td class="head checkbox-select"><input type="checkbox" name="select_checkall" id="select_checkall" title="<?php echo __('to_checkall',null,'table_list')?>" class="chk-select"/></td>
					<td class="head name"><?php echo __('head_name',null,'company_companies')?></td>
					<td class="head name"><?php echo __('head_available',null,'company_companies')?></td>
					<td class="head name"><?php echo __('head_total',null,'company_companies')?></td>					
					<td class="head city"><?php echo __('head_city',null,'company_companies')?></td>
				</tr>
				<?php 
				$count_for = 0;
				foreach($data['list'] as $val):
					$count_jobs = JobsTable::getDataListCount(array('filter_enabled'=>'1','filter_company_id'=>$val['id']));
					$count_jobs_availabe = JobsTable::getDataListAvailable(array('filter_enabled'=>'1','filter_company_id'=>$val['id']));
				?>
				<tr class="class<?php echo ++$count_for%2?> enable-<?php echo intval($val['is_enabled'])?>">
					<td class="checkbox-select"><input type="checkbox" name="select_list[]" class="select_list" value="<?php echo $val['id']?>" id="select_<?php echo $val['id']?>" title="<?php echo __('to_check',null,'table_list')?>" /></td>
					<td class="name">
						<a href="#" class="a-control-get edit" data-action="<?php echo ADMIN_DEFINED::EDIT_RECORD?>&id=<?php echo $val['id']?>" data-require="none">
							<?php echo $val['company_name']?></a>						
					</td>
					<td class="city"> 
						 <a href="<?php echo '/admin/companies/jobs?'. urlencode('filter[filter_search_method_id]').'=0&'. urlencode('filter[filter_company_id]').'='.$val['id']?>" target="_blank"><?php echo $count_jobs_availabe?></a>
					</td>
					<td class="city"> 
						<a href="<?php echo '/admin/companies/jobs?'. urlencode('filter[filter_search_method_id]').'=1&'. urlencode('filter[filter_company_id]').'='.$val['id']?>" target="_blank"><?php echo $count_jobs?></a>
					</td>
					<td class="city">
						<?php echo $val['LocationCities']['name']?>
					</td>
				</tr>
				<?php endforeach;?>
				<?php if($count_for ==0):?>
				<tr>
					<td colspan="4">
						<div  class="note"><?php echo __('no_row_founded',null,'table_list')?></div>
					</td>
				</tr>
				<?php endif;?>
			</table>
		</div>
		<div class="clr"></div>
		<div class="control">
			<a href="#" class="a-control-get add" data-action="<?php echo ADMIN_DEFINED::ADD_RECORD?>" data-require="none"><?php echo __('control_add',null,'table_list')?></a>
			<a href="#" class="a-control delete" data-action="<?php echo ADMIN_DEFINED::DELETE_RECORD?>" data-require="selected"><?php echo __('control_delete',null,'table_list')?></a>
		</div>
		<?php if(count($data['pagination_pager'])>1):?>
		<div class="pagination">
			<span><?php echo __('pagination_text',null,'table_list')?></span>
			<span class="pagination"> 
			<?php foreach ($data['pagination_pager'] as $p):?>
				<a href="<?php echo empty($p['url'])?'#':($data['app_prefix'].$p['url'])?>" class="<?php echo $p['page_class']?>"><?php echo $p['page_num']?></a>
			<?php endforeach;?>
			</span>
			<div class="clr"></div>
		</div>
		<?php endif;?>
		<div class="clr"></div>
	</form>
</div>